﻿using RecruitStudents.Client.BLL;
using RecruitStudents.Utility;
using RecruitStudents.Utility.Helper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RecruitStudents.Client.Examinee
{
    public partial class Examinee_OnSiteRegistrationForm_List : BaseForm
    {
        ServiceExaminee service = new ServiceExaminee();
        public Examinee_OnSiteRegistrationForm_List()
        {
            InitializeComponent();
        }
        #region 查询方法
        private void searchInfo()
        {
            //if (txtIdCard.Text.Trim() == "")
            //{
            //    DevHelper.ShowInfoMessageBox("请填写身份证号码！");

            //    return;
            //}

            //if (!(txtIdCard.Text.Trim().Length == 15 || txtIdCard.Text.Trim().Length == 18))
            //{
            //    DevHelper.ShowInfoMessageBox("输入的身份证号码的位数不对！");

            //    return;
            //}

            //if (!CheckIDCard.Check(txtIdCard.Text.Trim()))
            //{
            //    DevHelper.ShowInfoMessageBox("输入的身份证号码【格式错误】，验证不通过！");

            //    return;
            //}

            ////删除上次所拍的照片                
            //if (System.IO.File.Exists(Application.StartupPath + "\\zp.bmp"))
            //{
            //    System.IO.File.Delete(Application.StartupPath + "\\zp.bmp");
            //}
           

            //if (GetExamPlace_Limit(strExamCity) != null)
            //{
            //    DevHelper.ShowInfoMessageBox("对不起，此考点没有权限现场报名！");
            //}
            //else
            //{
            //    DataTable dt = service.GetExameeByIdentityCard(txtIdCard.Text.Trim());

            //    if (dt == null || dt.Rows.Count == 0)  //该考生第一次报名
            //    {
            //        Examinee_OnSiteRegistrationForm_New obj = new Examinee_OnSiteRegistrationForm_New();
            //        obj.strID = txtIdCard.Text.Trim();
            //        obj.Run();
            //        txtIdCard.Text = "";
            //    }
            //    else //该考生已报过名
            //    {
            //        DataTable dt2 = service.GetExameeNetPayFeeDataTable_New(txtIdCard.Text.Trim());
            //        if (dt2 == null || dt2.Rows.Count == 0)//没有报过任何专业(没有报过任何专业时，则不存在确认缴费的情况)
            //        {
            //            Examinee_OnSiteRegistrationForm_Pack obj = new Examinee_OnSiteRegistrationForm_Pack();
            //            obj.strID = txtIdCard.Text.Trim();
            //            obj.Run();
            //            txtIdCard.Text = "";
            //        }
            //        else
            //        {
            //            bool flagFee = false;

            //            foreach (DataRow dr in dt2.Rows)
            //            {
            //                if (dr["IsFee_First"].ToSafeString() == "1")
            //                    flagFee = true;
            //            }

            //            if (flagFee)
            //            {
            //                Examinee_OnSiteRegistrationForm_Pack obj = new Examinee_OnSiteRegistrationForm_Pack();
            //                obj.strID = txtIdCard.Text.Trim();
            //                obj.Run();
            //                txtIdCard.Text = "";
            //            }
            //            else
            //            {
            //                Examinee_OnSiteRegistrationForm_Confirm obj = new Examinee_OnSiteRegistrationForm_Confirm();
            //                obj.strIdentityCard = txtIdCard.Text.Trim();
            //                obj.Run();
            //                txtIdCard.Text = "";
            //            }
            //        }
            //}
        //}
    }
        #endregion

        private void btnQuery_Click(object sender, EventArgs e)
        {
            searchInfo();
        }

        private void btnScan_Click(object sender, EventArgs e)
        {
            Examinee_OnSiteRegistrationForm_New option = new Examinee_OnSiteRegistrationForm_New();
            if (option.ShowDialog() == DialogResult.OK)
            {
               
            }
        }
    }
}
